<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

	<h:head><h1>Ricerca / Visualizza Pacchetti</h1>
		  <style type="text/css">
        .ui-layout-unit{
             border: none;
        }
    </style>
	<link type="text/css" href="../generalstyle.css" rel="stylesheet"/>
	
	</h:head>
<body>
	<img src="http://www.mediterraneanfood.it/pacco2.gif" alt="" height="200" width="300"/>
	 <h:form>
        <p:menubar>  
                <p:menuitem value="Home" url="../home.xhtml" />  
				<p:menuitem value="Area Cliente" url="../cliente/homeCliente.xhtml" />
				<p:menuitem value="Area Impiegato" url="../impiegato/homeImpiegato.xhtml" /> 
				<p:menuitem value="Login" url="../login.xhtml" rendered="#{request.remoteUser == null}" />
                <p:menuitem value="Logout" actionListener="#{logoutManagedBean.logout()}" rendered="#{request.remoteUser != null}" />
		</p:menubar>
		</h:form>
	<h:form>

		
				<p:layout style=" height:80px;">
			<p:layoutUnit position="west" size="150">
				<p:outputLabel for="cerca" value="Nome Pacchetto" />
			</p:layoutUnit>
			
			<p:layoutUnit position="east">
				<p:commandButton value="CERCA" actionListener="#{PacchettoManagedBean.cercaPacchetti()}" ajax="false" />
				<p:commandButton value="VISUALIZZA" actionListener="#{PacchettoManagedBean.visualizzaPacchetti()}" ajax="false" />
			</p:layoutUnit>

			<p:layoutUnit position="center">
				<p:inputText id="cerca" value="#{PacchettoManagedBean.cerca}" requiredMessage="Campo obbligatorio"  />
			</p:layoutUnit>
		</p:layout>
		
	</h:form>
<ul>


    <ui:repeat value="#{PacchettoManagedBean.pacchetti}" var="packCorr" varStatus="statoPack">
        <h:form>
         <p:layout style=" height:100px;">
				<p:layoutUnit position="center">
				
					<p:layout style="height:50px;" >
						<p:layoutUnit position="west" size="200">
							<p:outputLabel value="Nome Pacchetto: " />
							<p></p>
							<p:outputLabel value="Numero Persone: " />
							<p></p>
						</p:layoutUnit>
						
						<p:layoutUnit position="center">
    						<p:outputLabel id="nome" value="#{packCorr.nome}" />
    						<p></p>
    						<p:outputLabel id="numeroPersone" value="#{packCorr.numeroPersone}" />    	
						</p:layoutUnit>
					</p:layout>
					
				</p:layoutUnit>
				<p:layoutUnit position="east" size="600">
				 <p:button outcome="./modificaPacchetto.xhtml?id=#{PacchettoManagedBean.pacchetti.get(statoPack.index).idPacchetto}&amp;crea=false" value="MODIFICA" />
				 <p:commandButton actionListener="#{PacchettoManagedBean.rimuoviPacchetto(PacchettoManagedBean.pacchetti.get(statoPack.index).idPacchetto)}" value="RIMUOVI" ajax="false" />
				</p:layoutUnit>
			</p:layout>
        </h:form>
    </ui:repeat>
    
   
    
    
</ul>
</body>
</html>